﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            Student stu = new Student();
            stu.iD = 88888888;
            stu.name = "马六甲";
            stu.sex = '男';
            stu.cardid = 1234567890;
            stu.tel = 10086;
            stu.major = "软工";
            stu.grade = "大一";
            stu.DDO();

            Teacher tea = new Teacher();
            tea.iD = 6784321;
            tea.name = "英子";
            tea.sex = '女';
            tea.cardid = 952754188;
            tea.tel = 541288;
            tea.title = "一级教师";
            tea.wageno = 3411;
            tea.DDO();
            Console.ReadKey();

        }
    }
    class Student : Person
    {
        private string Major;//专业
        private string Grade;//年级
        public string major
        {
            get { return this.Major; }
            set { this.Major = value; }
        }
        public string grade
        {
            get { return this.Grade; }
            set { this.Grade = value; }
        }
        public Student(string Mahor,string Grade) 
        {
            this.Major = Mahor;
            this.Grade = Grade;
        }
        public Student() { }
        public void DDO() 
        {
            Console.WriteLine("你是学生");
            base.DDO();
            Console.WriteLine("专业为:{0},年级为:{1}", this.Major, this.Grade);
        }
    }
    class Teacher : Person
    {
        private string Title;//职称
        private int Wageno;//工资号
        public string title
        {
            get { return this.Title; }
            set { this.Title = value; }
        }
        public int wageno
        {
            get { return this.Wageno; }
            set { this.Wageno = value; }
        }
        public Teacher(string Title,int Wageno) 
        {
            this.Title = Title;
            this.Wageno = Wageno;
        }
        public Teacher() { }
        public void DDO() 
        {
            Console.WriteLine("你是老师");
            base.DDO();
            Console.WriteLine("职称为：{0},工资号为：{1}", this.Title,this.Wageno);
        }
    }
    class Person 
    {
        private int ID;//编号
        private string Name;//姓名
        private char Sex;//性别
        private int Cardid;//身份证号
        private int Tel;//联系方式
        public int iD
        {
            get { return this.ID; }
            set { this.ID = value; }
        }
        public string name
        {
            get { return this.Name; }
            set { this.Name = value; }
        }
        public char sex
        {
            get { return this.Sex; }
            set { this.Sex = value; }
        }
        public int cardid
        {
            get { return this.Cardid; }
            set { this.Cardid = value; }
        }
        public int tel
        {
            get { return this.Tel; }
            set { this.Tel = value; }
        }
        public Person(int ID,string Name,char Sex,int Cardid,int Tel) 
        {
            this.ID = ID;
            this.Name = Name;
            this.Sex = Sex;
            this.Cardid = Cardid;
            this.Tel = Tel;
        }
        public Person() 
        {

        }
        public void DDO() 
        {
            Console.Write("编号为:{0},姓名为:{1},性别为:{2},身份证号为:{3},联系方式为:{4},", this.ID, this.Name, this.Sex, this.Cardid, this.Tel);
        }
    }
}
